package com.example.martian.controller;

import com.example.martian.huobi.client.MarketClient;

import com.example.martian.service.HuobiService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.money.CurrencyUnit;
import javax.money.NumberValue;
import javax.money.convert.ExchangeRate;
import javax.money.convert.ExchangeRateProvider;
import javax.money.convert.MonetaryConversions;


@Controller
@RequestMapping("/huobi/")
@CrossOrigin
public class HuobiController {

    @Autowired
    private HuobiService huobiService;

    /**
     *
     * ltc和ETH fil和ltc 不支持
     * @return
     * @throws Exception
     */
    @ResponseBody
    @RequestMapping(value = "trade")
    public Object getMarketTrade() {
        return huobiService.getMarketTrade();
    }

    @ResponseBody
    @RequestMapping(value = "getSymbols")
    public Object getSymbols(){
        return huobiService.getSymbols();
    }

    @ResponseBody
    @RequestMapping(value = "getAccountId")
    public Object getAccountId(){
        return huobiService.getAccountId();
    }
}
